<template>
  <cu-layout :navProp="{ placeholder: true }" :bgStyle="{ color: '#ffffff' }">
    <view :class="[`${prefixCls}-privacy-policy-container`]">
      <view v-for="(item, index) in privacyPolicyList" :key="index" class="privacy-item" @click="handleJump(item)">
        <span class="title">{{ item.title }}</span>
        <span class="tips">{{ item.tips }}</span>
        <uv-icon name="arrow-right" size="14"></uv-icon>
      </view>
    </view>
  </cu-layout>
</template>

<script>
import { mapActions, mapGetters } from 'vuex'

export default {
  name: 'componentName',
  components: {},
  mixins: [],
  props: {},
  data() {
    return {
      privacyPolicyList: [
        { title: '苏享家隐私政策摘要', subtitle: 'privacy_policy_summary' },
        { title: '苏享家隐私政策', subtitle: 'privacy_policy' },
        { title: '附加业务功能个人信息说明', subtitle: 'additional_personal_information' },
        { title: '违法和不良信息举报', subtitle: 'illegal_and_adverse_reports' },
      ],
    }
  },
  // 侦听属性
  watch: {},
  // 计算属性
  computed: {
    ...mapGetters(['isLogin']),
  },
  // 监听页面加载，该钩子被调用时data,computed,function,watch,props,slots已设置完成
  onLoad(options) {
    // if (this.isLogin) {
    //   this.privacyPolicyList.push({ title: '注销用户', path: '/pages/subpackage/privacy-policy/logout', tips: '账号将永久注销，无法恢复' })
    // }
  },
  // 监听页面显示，页面每次出现在屏幕上都触发
  onShow() {},
  // 监听页面初次渲染完成，此时组件已挂载完成
  onReady() {},
  // 下拉刷新
  onPullDownRefresh() {},
  // 加载更多
  onReachBottom() {},

  created() {},
  mounted() {},
  destroyed() {},
  methods: {
    ...mapActions([]),
    handleJump({ subtitle, title }) {
      // /pages/subpackage/privacy-policy/privacy-detail
      this.$ROUTE.go(`/pages/subpackage/privacy-policy/privacy-detail?title=${title}&subtitle=${subtitle}`)
    },
  },
}
</script>

<style lang="scss" scoped>
page {
  background: white !important;
}
.#{prefixCls('privacy-policy-container')} {
  background: #ffffff;
  box-sizing: border-box;
  padding: 0 32rpx;
  .privacy-item {
    border-bottom: 2rpx solid #f1f1f1;
    padding: 32rpx 0;
    font-size: 32rpx;
    display: flex;
    align-items: center;
    .title {
      font-size: 14px;
    }
    .tips {
      margin-left: auto;
      font-size: 24rpx;
      color: #909399;
    }
  }
}
</style>
